var o = getApp();

module.exports = {
    request: function(t) {
        var a = t.data, e = t.url, s = t.method, l = t.header, d = t.hideModal ? 1 : 0, n = t.loadMsg ? t.loadMsg : "努力搬运宝贝中", c = t.loadMsg ? "none" : "loading";
        wx.showToast({
            title: n,
            icon: c,
            mask: !0
        }), setTimeout(function() {
            wx.request({
                url: e,
                data: a,
                method: s,
                header: l,
                success: function(a) {
                    o.globalData.globalFormIds && o.uploadFormIds(), a.data.success || d || wx.showModal({
                        title: "提示",
                        content: a.data.msg,
                        showCancel: !1
                    }), t.success(a);
                },
                fail: function() {
                    wx.showModal({
                        title: "提示",
                        content: "获取数据失败",
                        showCancel: !1
                    }), t.fail();
                },
                complete: function() {
                    wx.hideToast();
                }
            });
        }, 500);
    }
};